<?php
namespace app\api\controller;
use think\Log;
use think\Session;
use app\common\model\Goods;
/**
 * 交易中心
 */
class Trade extends Api{
    protected function _initialize(){
        parent::_initialize();
        if($this->auth->isLogin() == false){
            $url =  $this->request->url();
            Session::set('referUrl',$url);
            $this->redirect('Login/index');
            exit();
        }
    }
    public function Index(){
        $list = Goods::where('status',1)->select();
        $this->assign('list',$list);
        return $this->view->fetch();

    }
}